﻿<local:DocumentBase x:Class="WPFExcelReport.AB45GAAUF"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="浆纱配纱"  Background="White"
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch" >
    <local:DocumentBase.Resources>
        <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp" IsExpanded="True"
                          Background="White"
                          Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=ARTICLE}" />
                                    <TextBlock Text="{Binding Path=ItemCount}"/>
                                    <TextBlock Text="Items"/>
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource  x:Key="FlickrGroupedFeed" Source="{Binding Path=WASTAMM,Source={StaticResource iNTEXDataSet}}">
        </CollectionViewSource>
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="600" />
            <ColumnDefinition Width="400" />
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" Margin="10,0,0,0"  Name="btnQuery" Width="75" Click="btnQuery_Click" />
            <Button Content="生成报表" Margin="10,0,0,0"   Height="23"   Name="btnReport" Width="75" Click="btnReport_Click" />
        </WrapPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel Height="46">
                <Label  FontSize="18" Content="浆纱单号" Height="24" Name="label1" Width="75" Margin="10,10,0,0" />
                <TextBox FontSize="18"  Height="34"  Background="Pink"  CharacterCasing="Upper" Width="47" Name="txtAUFKRS" Margin="5,10,0,0" Text="" />
                <TextBox  FontSize="18" Height="34"  Background="Beige"  CharacterCasing="Upper" Width="130" Name="txtAUFLFD"   Margin="5,10,0,0" Text="" />
                <TextBox  FontSize="18" Height="34"  Background="Yellow"  CharacterCasing="Upper" Width="50" Name="txtAUFPOS"   Margin="5,10,0,0" Text="" />
           </WrapPanel>
        </StackPanel>
        <WrapPanel Grid.Row="2"  Grid.Column="0"  Grid.ColumnSpan="2">
            <fd:FilteringDataGrid 
            AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                               ItemsSource="{Binding}"  
                                            HeadersVisibility="Column"
                                              x:Name="MasterDg" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="1000"
                                              Height="500"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="SUMDataGrid_SelectionChanged"
                                              >
                <DataGrid.Columns>
                    <!--ORDERDAT,'' AS ARTICLE, ORDERQTY, YARN,  YARNDES,COLORDES REQWEI, ALLWEI, "
                     REMAINWEI-->
                    <DataGridTextColumn Binding="{Binding Path=ORDERNO}" Header="浆纱单号" Width="SizeToCells" MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=FACTORY}" Header="浆纱厂" Width="SizeToCells" MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=ORDERDAT}" Header="开单日期" Width="SizeToCells" MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="品种" Width="SizeToCells" MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=ORDERQTY}" Header="计划浆长M" Width="SizeToCells" MinWidth="50"/>
                    <DataGridTextColumn Binding="{Binding Path=YARN}" Header="纱线编号" Width="SizeToCells" MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=YARNDES}" Header="纱线描述" Width="SizeToCells" MinWidth="100"/>
                    <DataGridTextColumn Binding="{Binding Path=COLORDES}" Header="颜色" Width="SizeToCells" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=SPPART}" Header="纺批" Width="SizeToCells" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=REQWEI}" Header="需求数量" Width="SizeToCells" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ALLWEI}" Header="留位数量" Width="SizeToCells" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=REMAINWEI}" Header="剩余数量" Width="SizeToCells" MinWidth="40"/>
                </DataGrid.Columns>
            </fd:FilteringDataGrid>
        </WrapPanel>
    </Grid>
</local:DocumentBase>

